<?php 

if(!empty($_POST['idUser']) && !empty($_POST['suppr'])) //Deleting a user
{
	User::delete($_POST['idUser']);
}

if(!empty($_POST['idUser']) && !empty($_POST['edit'])) //Editing a user (only status)
{
	$editUser = User::read($_POST['idUser']);
	$editUser->setIdRoleUser($_POST['role']);
	$editUser->save();
}

$usersList = User::listing();

$rolesList = Role::listing();

include('partials/users.php');

?>